package com.situ.day3;

import java.awt.font.NumericShaper;
import java.util.Random;
import java.util.Scanner;

import org.junit.Test;

public class DayThree {

	public static void main(String[] args) {
		int randomNumber = new Random().nextInt(100) + 1;
		Scanner scanner = new Scanner(System.in);
		while (true) {
			System.out.println("猜吧！");
			int num = scanner.nextInt();
			while (num != 0) {
				if (num > randomNumber) {
					System.out.println("太大了!");
					break;
				} else if (num < randomNumber) {
					System.out.println("太小了");
					break;
				} else {
					System.out.println("恭喜你，猜对了！");
					// 退出当前循环，只能退出一层循环
					break;
				}
			}
			while (num == 0) {
				System.out.println("游戏结束！");
				break;
			}
		}
	}
	
}
